package util;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class ResultUtil {

    public static String getJSON(Object o){

        Result result=Result.success(o);
        String json= JSON.toJSONString(result, SerializerFeature.WriteNullStringAsEmpty);

        return json;
    }
    public static String getJSON(Object o,String msg){

        Result result=Result.success(o);
        result.setMsg(msg);
        String json= JSON.toJSONString(result, SerializerFeature.WriteNullStringAsEmpty);

        return json;
    }
}
